package com.FundamentalDemos.Scanner的使用;

import java.util.Scanner;

public class ScannerDemo {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入您的年龄:");
        int age = scanner.nextInt();//读取整数
        System.out.println("年龄是:" + age);
        System.out.println("请输入您的姓名:");
        String name = scanner.next();//读取字符串
        System.out.println(name + ",欢迎您!");

    }

}
